import request from '@/utils/request'

// 查询试题分类列表
export function listClassification(query) {
  return request({
    url: '/system/classification/list',
    method: 'get',
    params: query
  })
}

// 查询试题分类详细
export function getClassification(entityClassificationId) {
  return request({
    url: '/system/classification/' + entityClassificationId,
    method: 'get'
  })
}

// 新增试题分类
export function addClassification(data) {
  return request({
    url: '/system/classification',
    method: 'post',
    data: data
  })
}

// 修改试题分类
export function updateClassification(data) {
  return request({
    url: '/system/classification',
    method: 'put',
    data: data
  })
}

// 删除试题分类
export function delClassification(entityClassificationId) {
  return request({
    url: '/system/classification/' + entityClassificationId,
    method: 'delete'
  })
}



// 查询试题库列表
export function listBank(query) {
    return request({
      url: '/system/bank/list',
      method: 'get',
      params: query
    })
  }
  
  // 查询试题库详细
  export function getBank(itemBankId) {
    return request({
      url: '/system/bank/' + itemBankId,
      method: 'get'
    })
  }
  
  // 新增试题库
  export function addBank(data) {
    return request({
      url: '/system/bank',
      method: 'post',
      data: data,
      // headers:{
      //   'Content-Type':'text/html;charset=utf-8'
      // }
    })
  }
  
  // 修改试题库
  export function updateBank(data) {
    return request({
      url: '/system/bank',
      method: 'put',
      data: data
    })
  }
  
  // 删除试题库
  export function delBank(itemBankId) {
    return request({
      url: '/system/bank/' + itemBankId,
      method: 'delete'
    })
  }

  
  
// 查询答案列表
export function listAnswer(query) {
  return request({
    url: '/system/answer/list',
    method: 'get',
    params: query
  })
}

// 查询答案详细
export function getAnswer(answerId) {
  return request({
    url: '/system/answer/' + answerId,
    method: 'get'
  })
}

// 新增答案
export function addAnswer(data) {
  return request({
    url: '/system/answer',
    method: 'post',
    data: data
  })
}

// 修改答案
export function updateAnswer(data) {
  return request({
    url: '/system/answer',
    method: 'put',
    data: data
  })
}

// 删除答案
export function delAnswer(answerId) {
  return request({
    url: '/system/answer/' + answerId,
    method: 'delete'
  })
}

// ocr
export function getOcr(data) {
  return request({
    url: '/system/bank/ocr',
    method: 'post',
    data: data
  })
}

